package controller;

import entity.Type;
import service.TypeService;
import service.impl.TypeServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @version 1.0
 * @Author: xxf
 * @CreateDate: 2020/9/30 14:07
 */
@WebServlet("/type")
public class TypeController extends BaseController {

    private TypeService service = new TypeServiceImpl();

    /**
     * 查询商品列表
     * @param request
     * @param response
     * @return  返回json数据
     */
    public void findAll(HttpServletRequest request, HttpServletResponse response) throws IOException {

        List<Type> list = service.findAll();
        writeValue(list,response);

//        return "";
    }
}
